package com.huike.pmps.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huike.pmps.model.entity.BusinessOpportunity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 作者：谌贵斌(黑桃K)
 * 日期: 2888-08-08
 * 老师QQ: 272488352
 * 官方QQ交流群: 377748272
 * 刀客程序员官网：http://www.daoke360.com
 * 刀客程序员淘宝旗舰店：https://daoke360.taobao.com/
 */
public interface BusinessOpportunityDao extends BaseMapper<BusinessOpportunity> {

    @Insert({
            "<script>",
            "insert into p_business_opportunity (",
            "  bo_no,                            ",
            "  bo_title,                         ",
            "  region_id,                        ",
            "  region_name,                      ",
            "  province_id,                      ",
            "  province_name,                    ",
            "  charge_name,                      ",
            "  customer_name,                    ",
            "  product_name,                     ",
            "  product_no,                       ",
            "  product_number,                   ",
            "  stage,                            ",
            "  contract_amount,                  ",
            "  sign_date                         ",
            ")values                             ",
            "<foreach collection='businessOpportunityList' item='item' index='index' separator=','>",
            "(   					 ",
            " #{item.boNo},          ",
            " #{item.boTitle},       ",
            " #{item.regionId},      ",
            " #{item.regionName},    ",
            " #{item.provinceId},    ",
            " #{item.provinceName},  ",
            " #{item.chargeName},    ",
            " #{item.customerName},  ",
            " #{item.productName},   ",
            " #{item.productNo},     ",
            " #{item.productNumber}, ",
            " #{item.stage},         ",
            " #{item.contractAmount},",
            " #{item.signDate}       ",
            ")                       ",
            "</foreach>",
            "</script>"
    })
    int insertBatchList(@Param(value = "businessOpportunityList") List<BusinessOpportunity> businessOpportunityList);
}
